package it.controllocredito.wizard.model;

import android.support.v4.app.Fragment;
import android.text.TextUtils;

import it.controllocredito.wizard.ui.WeekDayInfoFragment;

import java.util.ArrayList;

/**
 * La pagina relativa alle informazioni sul giorno della settimana in cui si rinova l'offerta.
 */
public class WeekDayInfoPage extends MultipleFixedChoicePage {
    public static final String WEEKDAY_DATA_KEY = "weekDay";
    
    public WeekDayInfoPage(ModelCallbacks callbacks, String title) {
        super(callbacks, title);
    }

    @Override
    public Fragment createFragment() {
        return WeekDayInfoFragment.create(getKey());
    }

    @Override
    public void getReviewItems(ArrayList<ReviewItem> dest) {
        dest.add(new ReviewItem("Giorno di rinnovo dell'offerta", mData.getString(WEEKDAY_DATA_KEY), getKey(), -1));
    }

    @Override
    public boolean isCompleted() {
        return !TextUtils.isEmpty(mData.getString(WEEKDAY_DATA_KEY));
    }
}